package com.ross.dao;

import com.ross.pojo.SysPermissions;
import com.ross.pojo.SysRoles;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysRolesMapper {
    void correlationPermissions(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    void uncorrelationPermissions(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    boolean exists(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    SysRoles findById(Long id);

    void create(SysRoles role);

    void deleteUserRole(Long roleId);

    void deleteRole(Long roleId);

    List<SysRoles> findAll();

    List<SysPermissions> findRolePermissionByRoleId(Long id);

    List<SysPermissions> findPermissionByRoleId(Long id);

    void update(SysRoles role);

    void deleteAllRolePermissions(Long id);

    void updateUserRole_Id(SysRoles role);
}